package router

import (
	"github.com/gin-gonic/gin"
	"mxshop_api/goods_web/api/goods"
	"mxshop_api/goods_web/middlewares"
)

func GoodsRouter(group *gin.RouterGroup) {
	GoodsRouter := group.Group("goods").Use(middlewares.Trace(), middlewares.JWTAuth())
	{
		GoodsRouter.GET("", goods.List)
		GoodsRouter.POST("", goods.New)
		GoodsRouter.GET("/:id", goods.Detail)
		GoodsRouter.PUT("/:id", goods.Update)
		GoodsRouter.DELETE("/:id", goods.Delete)
	}
}
